home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Draw / Include / DrwDDCmd.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.5 KB  |  118 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                DrwDDCmd.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Author:                Mary Boetcher
  7. //
  8. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef DRWDDCMD_H
  13. #define DRWDDCMD_H
  14.  
  15. // ----- FrameWork Includes -----
  16.  
  17. #ifndef FWDRCMD_H
  18. #include "FWDrCmd.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Forward Declarations
  23. //========================================================================================
  24.  
  25. #if FW_LIB_EXPORT_PRAGMAS
  26. #pragma lib_export on
  27. #endif
  28. class FW_CLASS_ATTR ODDragItemIterator;
  29. class FW_CLASS_ATTR FW_CFrame;
  30. class FW_CLASS_ATTR FW_CPrivOrderedCollection;
  31. #if FW_LIB_EXPORT_PRAGMAS
  32. #pragma lib_export off
  33. #endif
  34.  
  35. class FW_CLASS_ATTR CDrawPart;
  36. class FW_CLASS_ATTR CDrawSelection;
  37. class FW_CLASS_ATTR CDrawSubscribeLink;
  38. class FW_CLASS_ATTR CDrawLinkManager;
  39.  
  40. //========================================================================================
  41. // class CDragCommand - for dragging
  42. //========================================================================================
  43.  
  44. class FW_CLASS_ATTR CDragCommand : public FW_CDragCommand
  45. {
  46.   public:
  47.  
  48.     CDragCommand(Environment* ev, 
  49.                  CDrawPart* part,
  50.                  FW_CFrame* frame,
  51.                  CDrawSelection* selection,
  52.                  FW_Boolean canUndo);
  53.  
  54.     virtual ~ CDragCommand();
  55.  
  56.     // --- FW_CCommand overrides
  57.     virtual void UndoIt(Environment* ev);            // Override
  58.     virtual void RedoIt(Environment* ev);            // Override
  59.     virtual void SaveUndoState(Environment* ev);    // Override
  60.     virtual void FreeUndoState(Environment *ev);    // Override
  61.  
  62.   protected:
  63.     CDrawPart*            fDrawPart;
  64.     CDrawSelection*        fDrawSelection;
  65.     FW_CPrivOrderedCollection*    fClearedShapeList;
  66.  
  67.     void SelectDraggedShapes(Environment* ev);
  68. };
  69.  
  70. //========================================================================================
  71. // class CDropCommand - for dropping
  72. //========================================================================================
  73.  
  74. class FW_CLASS_ATTR CDropCommand : public FW_CDropCommand
  75. {
  76.   public:
  77.     CDropCommand(Environment* ev, 
  78.                  CDrawPart* itsPart,
  79.                  FW_CFrame* frame,
  80.                  ODDragItemIterator* dropInfo, 
  81.                  ODFacet* facet, 
  82.                  const FW_CPoint& windowPoint,
  83.                  FW_Boolean canUndo);
  84.  
  85.     virtual ~ CDropCommand();
  86.  
  87.     virtual void UndoIt(Environment* ev);            // Override
  88.     virtual void RedoIt(Environment* ev);            // Override
  89.     virtual void CommitUndone(Environment *ev);    // Override
  90.     virtual void SaveRedoState(Environment* ev);    // Override
  91.     virtual void FreeRedoState(Environment* ev);    // Override
  92.  
  93.     // --- FW_CDropCommand overrides
  94.     virtual FW_Boolean DoDrop(Environment* ev, ODStorageUnit* dropSU, const FW_CPoint& originPoint, const FW_CPoint& dropPoint, FW_Boolean isDropMove);
  95.     virtual FW_Boolean DoDroppedInSameFrame(Environment* ev, ODStorageUnit* dropSU, const FW_CPoint& originPoint, const FW_CPoint& dropPoint);
  96.     virtual void DoDroppedPasteAs(Environment* ev, 
  97.                                   const FW_CPoint& originPoint, 
  98.                                   const FW_CPoint& dropPoint);    // Override
  99.  
  100.   protected:
  101.  
  102.     void OffsetSelection(Environment* ev, const FW_CPoint& delta);
  103.     void RestoreDroppedShapes(Environment* ev);
  104.     void SelectDroppedShapes(Environment* ev);
  105.  
  106.     CDrawLinkManager* GetDrawLinkManager(Environment* ev) const;
  107.  
  108.   private:
  109.     CDrawPart*                fDrawPart;
  110.     CDrawSelection*            fDrawSelection;
  111.     FW_CPoint                fDropDelta;
  112.     FW_CPrivOrderedCollection*        fDroppedShapeList;
  113.     CDrawSubscribeLink*        fSavedLink;
  114. };
  115.  
  116.  
  117. #endif
  118.